package com.foreknow.service;

import com.foreknow.entity.Rule;
import com.foreknow.entity.User;

import java.util.List;

public interface RuleService {
    /**
     * 根据id删除(物理删除)
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Integer id);
    /**
     * 根据id删除(逻辑删除)
     * @param record
     * @return
     */
    int deleteByRulenameByDeptIDByLogic(Rule record);
    /**
     * 根据数组批量删除(逻辑删除)
     * @param rules
     * @return
     */
    int deleteByRulenameByDeptIDByLogicBatch(List<Rule> rules);
    /**
     * 根据规则名称删除(逻辑删除)
     * @param rulename
     * @return
     */
    int deleteByRulenameByLogic(String rulename);
    /**
     * 添加
     * @param userList
     * @param rulename
     * @return
     */
    int insert(List<User> userList, String rulename);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    Rule selectByPrimaryKey(Integer id);
    /**
     * 根据rulename deptid 查询
     * @param record
     * @return
     */
    List<Rule> selectByRulenameDeptId(Rule record);
    /**
     *  查询所有不同科室不同名称的规则 可选参数 rulename deptid
     * @param record
     * @return
     */
    List<Rule> selectAllRulesByCondition(Rule record);
    /**
     * 根据record更新
     * @param record
     * @return
     */
    int updateByPrimaryKeySelective(Rule record);
    /**
     * 根据record更新
     * @param record
     * @return
     */
    int updateByPrimaryKey(Rule record);
}
